//
//  Profile.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-4.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddUserProfile.h"
#import "JddCommonFunction.h"
#import "JddGlobalParameter.h"

@implementation JddUserProfile

@synthesize macAddress;
@synthesize name;
@synthesize password;
@synthesize autoLogon;
@synthesize bindMobile;
@synthesize realName;
@synthesize IDCard;
@synthesize IsMobileBind;
@synthesize BankCardNumber;
@synthesize BankName;
@synthesize balance;
@synthesize userId;
@synthesize nextSendTimeDate;
@synthesize IsPayPwd;
@synthesize IsUnion;
@synthesize BandID;

+(JddUserProfile*)sharedInstance{
    static JddUserProfile *_profile = nil;
    if (!_profile) {
        _profile = [[JddUserProfile alloc] init];
        _profile.macAddress = [NSString stringWithString:[JddCommonFunction macAddress]];
    }
    
    return _profile;
}

+(void)clearMessage{
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_USER];
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_PASSWORD];
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_SAVE_PASSWORD];
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_AUTO_LOGON];
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_USER_ID];
    [[JddGlobalParameter sharedInstance].dictionary setObject:@"" forKey:GLOBAL_PARAMETER_SHOP_ID];
    
    [[JddGlobalParameter sharedInstance] save];
    [JddUserProfile sharedInstance].password = @"";
    [JddUserProfile sharedInstance].name = nil;
    [JddUserProfile sharedInstance].autoLogon = FALSE;
    [JddUserProfile sharedInstance].bindMobile = nil;
    [JddUserProfile sharedInstance].realName = nil;
    [JddUserProfile sharedInstance].IDCard = nil;
    [JddUserProfile sharedInstance].BankID = nil;
    [JddUserProfile sharedInstance].BankName = nil;
    [JddUserProfile sharedInstance].IsMobileBind = FALSE;
    [JddUserProfile sharedInstance].balance = @"0.0";
    [JddUserProfile sharedInstance].userId = nil;
    [JddUserProfile sharedInstance].IsPayPwd = FALSE;
    [JddUserProfile sharedInstance].IsUnion = false;
    [JddUserProfile sharedInstance].BandID = nil;
    
    [JddUserProfile sharedInstance].shopID = nil;
    [JddUserProfile sharedInstance].shopLogo = nil;
    [JddUserProfile sharedInstance].lotteries = nil;
    [JddUserProfile sharedInstance].shopTitle = nil;
    [JddUserProfile sharedInstance].shopPhone = nil;
    [JddUserProfile sharedInstance].isGetTicket = NO;
}

@end
